Skip to content

fix(polls): render full selection snapshots [AI-assisted] - #198

Merged
steipete merged 3 commits into
openclaw:mainfrom
clawSean:fix/poll-selection-snapshot-display
Aug 2, 2026
Merged

fix(polls): render full selection snapshots [AI-assisted]#198
steipete merged 3 commits into
openclaw:mainfrom
clawSean:fix/poll-selection-snapshot-display

Conversation

@clawSean

@clawSean clawSean commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • render native poll vote rows as full selection snapshots in plain
    history/watch output
  • stop describing the first snapshot entry as the option that just changed
  • document poll.votes as authoritative and poll.vote as a compatibility
    projection
  • cover multi-select, one-option-remaining, and empty-selection snapshots

Why

Apple's native poll vote rows carry a participant's full selected-option set,
not a single delta. pollDisplayText currently renders only poll.vote, which
is documented as the first decoded entry. Selecting a second option therefore
prints only the first option; removing one of two options can falsely describe
the remaining option as a new vote.

The JSON schema remains compatible. This change only makes human-readable
output follow the already-exposed poll.votes snapshot.

Evidence

The regression failed on current main with:

[poll vote] +15550002000 selected Lobster

for a snapshot containing both Lobster and Also lobster.

After the change:

[poll selections] +15550002000 selected Lobster / Also lobster

Verification on macOS 26:

  • full swift test: 488 tests passed
  • swift format lint --recursive Sources Tests TestsLinux: passed
  • git diff --check: passed
  • swiftlint was unavailable on the test host; CI remains authoritative for
    that lane

AI-assisted with Codex. I reviewed the resulting behavior and tests.

Live native-poll proof (2026-07-28)

Verified on the submitted head 62676f5c9da471018b12b32e44fa91857f745025 against a real native Messages poll on macOS 26.5.1. The participant identifier was redacted before posting.

After selecting a second option in the Messages UI, the patched CLI rendered:

[poll selections] participant-1 selected Beta / Alpha

After deselecting Alpha, leaving Beta selected, it rendered:

[poll selections] participant-1 selected Beta

This is the key negative case: the remaining Beta selection is described as the current snapshot, not as a new Beta vote.

Current-head validation:

  • swift test: 488 tests in 3 suites passed
  • swift format lint --recursive Sources Tests TestsLinux: passed
  • git diff --check origin/main...HEAD: passed

The earlier automated compile concern does not reproduce. MessagePollVote.optionID is a non-optional String; only optionText is optional, so vote.optionText ?? vote.optionID is a concrete String and the full current-head test build succeeds.

@clawSean
clawSean marked this pull request as ready for review July 27, 2026 19:34
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. labels Jul 27, 2026
@clawsweeper

clawsweeper Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 2:27 AM ET / 06:27 UTC.

ClawSweeper review

What this changes

Updates plain history and watch native-poll vote text to show every selected option from poll.votes, retains the established [poll vote] prefix, and adds regression coverage plus JSON/history documentation.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

This PR remains necessary and is ready to land once its in-progress Linux and macOS checks finish: current main still formats only the compatibility projection poll.vote, while the branch correctly formats the full poll.votes selection snapshot without changing JSON output.

Priority: P2
Reviewed head: 08c8c380de7abf1d83b9d90121d8566265c2eec9

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Strong real native-poll proof, focused regression coverage, and maintainer validation support landing once the remaining required checks complete.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR contains redacted after-fix native Messages output for both multi-selection and deselection snapshots, supplemented by maintainer-reported focused tests, full tests, lint, and build validation.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR contains redacted after-fix native Messages output for both multi-selection and deselection snapshots, supplemented by maintainer-reported focused tests, full tests, lint, and build validation.
Evidence reviewed 5 items Current-main behavior: Current main’s vote formatter reads only poll.vote, so a poll update carrying more than one decoded selection is reduced to the first entry in plain CLI output.
Focused branch repair: The maintainer-adjusted branch iterates poll.votes, groups visible selections by participant, preserves the [poll vote] prefix, and retains a fallback for older events exposing only poll.vote.
Real behavior proof and maintainer review: The PR body records a redacted macOS native-Messages reproduction showing a two-option snapshot and the one-option-after-deselection case; the August 2 maintainer comment confirms focused tests, full tests, lint, build, and recommends landing after CI completes.
Findings None None.
Security None None.

How this fits together

IMsgCore decodes native Apple Messages poll rows from the local Messages database into MessagePollEvent values. The CLI’s history and watch commands pass those events to a display helper, which produces the human-readable poll text users see outside JSON mode.

flowchart LR
  A[Messages poll row] --> B[Poll decoder]
  B --> C[Poll event with vote entries]
  C --> D[History and watch output]
  D --> E[Snapshot display decision]
  E --> F[Human-readable CLI text]
  C --> G[JSON poll object]
Loading

Before merge

  • Resolve merge risk (P1) - Plain non-JSON poll output now intentionally describes the current selection snapshot rather than a single apparent delta; the preserved prefix reduces disruption, but consumers parsing the trailing text as a delta need to adopt the documented semantics.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Patch scope 5 files affected; 89 added, 7 removed The change stays focused on one CLI formatter, three regression cases, and the corresponding poll contract documentation.
Selection regression coverage 3 cases added The tests cover multi-selection, a remaining single selection after deselection, and an empty snapshot.

Merge-risk options

Maintainer options:

  1. Land the corrected snapshot semantics (recommended)
    After the remaining required checks pass, accept the documented plain-output semantic correction while retaining the existing [poll vote] prefix.

Technical review

Best possible solution:

Land the focused formatter, regression tests, and documentation after required checks pass, keeping JSON fields unchanged and treating poll.votes as the authoritative snapshot for human-readable output.

Do we have a high-confidence way to reproduce the issue?

Yes. The PR includes redacted real native-Messages proof on macOS for a multi-select update and a subsequent deselection case, and current main source confirms it formats only the first decoded vote.

Is this the best way to solve the issue?

Yes. Rendering the already-exposed authoritative poll.votes snapshot in the plain formatter is narrower and safer than changing the JSON schema or inventing separate state tracking.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 02644cb5713b.

Labels

Label justifications:

  • P2: This is a bounded existing-output correctness fix for native poll history and watch rendering.
  • merge-risk: 🚨 compatibility: Existing scripts may interpret plain poll text as a delta, while this intentionally corrects it to report the current selection snapshot.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR contains redacted after-fix native Messages output for both multi-selection and deselection snapshots, supplemented by maintainer-reported focused tests, full tests, lint, and build validation.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR contains redacted after-fix native Messages output for both multi-selection and deselection snapshots, supplemented by maintainer-reported focused tests, full tests, lint, and build validation.

Evidence

What I checked:

  • Current-main behavior: Current main’s vote formatter reads only poll.vote, so a poll update carrying more than one decoded selection is reduced to the first entry in plain CLI output. (Sources/imsg/AttachmentDisplay.swift:30, 02644cb5713b)
  • Focused branch repair: The maintainer-adjusted branch iterates poll.votes, groups visible selections by participant, preserves the [poll vote] prefix, and retains a fallback for older events exposing only poll.vote. (Sources/imsg/AttachmentDisplay.swift:31, bd539a5a404c)
  • Real behavior proof and maintainer review: The PR body records a redacted macOS native-Messages reproduction showing a two-option snapshot and the one-option-after-deselection case; the August 2 maintainer comment confirms focused tests, full tests, lint, build, and recommends landing after CI completes. (bd539a5a404c)
  • Feature-history provenance: Blame attributes the current poll-display behavior to the v0.13.4 preparation commit, and the same area’s recent branch correction was authored by the person who recommended this PR land. (Sources/imsg/AttachmentDisplay.swift:30, 1d8b679cc3a3)
  • Release baseline: The current-main implementation is the released v0.13.4 baseline; this PR is not merged, and its changelog entry is under the unreleased 0.13.5 section, so the corrected behavior is not yet shipped. (CHANGELOG.md:3, 1d8b679cc3a3)

Likely related people:

  • steipete: Current-main blame ties the existing formatter to the v0.13.4 preparation commit, and recent PR commits include the output-compatibility adjustment and landing refresh. (role: current behavior author and recent area contributor; confidence: high; commits: 1d8b679cc3a3, bd539a5a404c, 08c8c380de7a; files: Sources/imsg/AttachmentDisplay.swift, CHANGELOG.md)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (23 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-31T07:36:14.335Z sha 62676f5 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-31T09:33:10.443Z sha 62676f5 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-31T16:03:33.847Z sha 62676f5 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-01T05:09:16.424Z sha 62676f5 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-01T11:54:46.507Z sha 62676f5 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-02T02:41:41.124Z sha 62676f5 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-02T05:08:20.578Z sha 62676f5 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-02T05:39:29.887Z sha bd539a5 :: needs maintainer review before merge. :: none

@clawSean

Copy link
Copy Markdown
Contributor Author

Updated the PR body with redacted real-behavior proof from the current head.

The live Messages UI produced a two-selection snapshot, then a one-selection snapshot after deselection. Head 62676f5c9da471018b12b32e44fa91857f745025 rendered both correctly, and the full Swift suite passed 488/488 tests. The prior compile concern does not reproduce because MessagePollVote.optionID is non-optional.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 28, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Jul 28, 2026
@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Maintainer repair is on the branch at bd539a5; I recommend landing this PR once CI finishes.

The functional fix remains the contributor’s: plain output now renders the authoritative poll.votes selection snapshot instead of the compatibility-only first poll.vote. I adjusted the final presentation to retain the established [poll vote] prefix, avoiding an unnecessary output compatibility break while still showing every selected option.

Proof on macOS arm64:

  • Focused utility tests passed, including two simultaneous selections, the remaining-selection case, and an empty snapshot.
  • make lint: passed with pre-existing warnings only.
  • make test: all 488 tests passed.
  • make build ARCHES="$(uname -m)": release CLI and universal helper built successfully; live ./bin/imsg --version reported 0.13.5.
  • The contributor’s native Messages poll reproduction on this PR demonstrates the bug and the corrected multi-selection output against a real local chat database. The maintainer follow-up changes only the stable prefix.
  • Local-diff and full-branch autoreviews: clean, no actionable findings.

No message or poll mutation was performed during maintainer verification.

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 2, 2026
Co-authored-by: clawSean <260045960+clawSean@users.noreply.github.com>
@steipete
steipete merged commit 79b92d4 into openclaw:main Aug 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants